In H.264/MPEG-4 AVC, one picture is divided into macroblocks to encode an image, the respective macroblocks are encoded by generating a prediction block using inter prediction or intra prediction. The difference between an original block and the prediction block is transformed to generate a transformed block, and the transformed block is quantized using a quantization parameter and one of a plurality of predetermined quantization matrices. The quantized coefficient of the quantized block are scanned by a predetermined scan type and then entropy-coded. The quantization parameter is adjusted per macroblock and encoded using a previous quantization parameter.
Meanwhile, techniques using various sizes of coding unit and transform unit are introduced to improve the coding efficacy. Techniques increasing a number of intra prediction modes are also introduces to generate a prediction block more similar to an original block.
But, the various sizes of coding unit and transform unit results in increase of coding bits of residual block when scanning a large transformed block. Also, the increase of the number of intra prediction modes requires more effective scanning method to reduce the coding bits of residual block.